﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<添加日志>
-- =============================================
CREATE PROCEDURE [dbo].[proc_WorkLog_Create]
(
	@Title NVARCHAR(200),
	@Content TEXT,
	@UserName NVARCHAR(50),
	@Name NVARCHAR(50),
	@CompanyId INT,
	@DepId INT,
	@LogType INT
)
AS
DECLARE @Cid INT
DECLARE @Did INT
BEGIN
	
	SELECT @Cid=Employee.CompanyId,@Did=Employee.DepartmentId FROM Employee WHERE UserName=@UserName
	
	INSERT INTO WorkLog
	(
		Title,
		[Content],
		UserName,
		Name,
		CompanyId,
		DepId,
		LogType
	)
	VALUES
	(
		@Title,
		@Content,
		@UserName,
		@Name,
		@Cid,
		@Did,
		@LogType
	)
	
END
